<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<script type="application/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
</head>

<body>

	<div>
		<form method="POST" enctype="multipart/form-data" action="/file/upload">
			<table>
				<tr><td>File to upload:</td><td><input type="file" name="file" /></td></tr>
				<tr><td></td><td><input type="submit" value="Upload" /></td></tr>
			</table>
		</form>
	</div>

<button onclick="selectUserById()">
	获取图片
</button>
<img src="/file/download?id=13" >
</body>
<script>
    function selectUserById() {
        //jQuery.get(url, [data], [callback], [type])
        var url = "http://localhost:8081/file/download"
        jQuery.get(url, {"id":10}, function (res) {
            console.info(res);
        },function(res) {
			console.error(res);
        }, "json");
    }
</script>
</html>
